#ifndef __SOCKETTCP_H_
#define __SOCKETTCP_H_

#include "BaseSocket.h"

#define TCP_SEND_LEN	100*1024
#define RECVBUFF_LEN	1024*1024

class DLL_EXT_CLASS CSocketTcp
	:public CBaseSocket
{
public:
	CSocketTcp(void);
	~CSocketTcp(void);

public:
	bool CreateSocket(void);
	bool Bind(unsigned short usPort);
	bool Listen(unsigned short usNum = 20);

	int Connect(const char *szIP, unsigned short usPort);
	SOCKET Accept(void);
	int RecvData(SOCKET nSocket, char *pBuff, int nLen);
	int RecvData(char *pBuff, int nLen);
	int ReadDataEx(SOCKET nSocket, char *pBuff, int nBuffLen);
	int SendData(SOCKET nSocket, const char *pData, int nLen);	
	int SendData(const char *pData, int nLen);
};
#endif
